In Attribute§
See primary documentation in context for Trait is default
An attribute that is assigned Nil will revert to its default value set with the trait is default
. In the case of arrays or associatives, the argument of is default
will set the default item value or hash value.
my = C.new;say ;.a = Nil;say ;# OUTPUT: «C.new(a => 666)C.new(a => 42)»;my = Foo.new( bar => <a b c> );.bar =Nil;say ; # OUTPUT: «Foo.new(bar => [42])»